package com.dd.cloud.common.annotate.validation;


import com.dd.cloud.common.annotate.validation.impl.WechatValidation;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 验证微信号
 */
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = WechatValidation.class)
public @interface Wechat {

    boolean required() default true;

    String message() default "微信号格式为6-20个字母、数字、下划线和减号，必须以字母开头";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
